import { Children, lazy } from "react";
import { Navigate } from 'react-router-dom'
import Index from "../promise/Ai";

import {
  AppOutline,
  MessageOutline,
  MessageFill,
  UnorderedListOutline,
  UserOutline,
} from 'antd-mobile-icons'
const Detail = lazy(()=>import("../promise/Detail"))
const Home = lazy(() => import("../promise/Home"))
const Login = lazy(() => import("../promise/Login"))
const Register = lazy(() => import("../promise/Register"))
const MayLoult = lazy(() => import("../promise/MayLoult"))
const My = lazy(() => import("../promise/My"))
const Message = lazy(() => import("../promise/Message"))
const Ai = lazy(() => import("../promise/Ai"))
const Liao = lazy(() => import("../promise/Liao"))

export const Tabbars = [
    {
        path: '/home',
        element: <Home />,
        title: '春雨',
        icon:<AppOutline/>
    },
    {
        path: '/detail',
        element: <Detail />,
        title: '商城',
        icon:<MessageOutline/>
    },
    {
        path: '/ai',
        element: <Ai />,
        title: '慧文Ai',
        icon:<Index/>
    },
      {
        path: '/message',
        element: <Message />,
        title: '我的订单',
        
         icon:<UnorderedListOutline/>
    },
    {
        path: '/my',
        element: <My />,
        title: '个人中心',
         icon: <UserOutline />
    },
  
]

export const routes = [
    {
        path: "/",
        element: <MayLoult />,
        children: [
            ...Tabbars,
            {
                path: '/',
                element:<Navigate to="/home"></Navigate>
            }
        ]
    },
    {
        path: '/login',
        element:<Login/>
    },
    {
        path: "/register",
        element:<Register/>
    },
    {
        path: "/liao",
        element:<Liao/>
    }
]